using Microsoft.Practices.Unity;
using SimpleCqrs;
using SimpleCqrs.Eventing;
using UnityServiceLocator = SimpleCqrs.Unity.UnityServiceLocator;

namespace Domain.Engine
{
  public class TestRuntime : SimpleCqrsRuntime<UnityServiceLocator>
  {
    private readonly IUnityContainer _container;

    public TestRuntime(IUnityContainer container)
    {
      _container = container;
    }

    protected override UnityServiceLocator GetServiceLocator()
    {
      return new UnityServiceLocator(_container);
    }

    protected override IEventStore GetEventStore(IServiceLocator serviceLocator)
    {
      return new MemoryEventStore();
    }
  }
}